//
//  ViewController.m
//  仿斗鱼主页OC版
//
//  Created by baohuai on 16/10/15.
//  Copyright © 2016年 baohuai. All rights reserved.
//

#import "ViewController.h"
#import "TitlePageView.h"

#define kPageViewH 40
@interface ViewController ()
@property (nonatomic, strong)TitlePageView * titlePageView; // 标题视图
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.automaticallyAdjustsScrollViewInsets = NO;
    [self setupUI]; //设置UI
    
}

-(void)setupUI {
    [self.view addSubview:self.titlePageView];
}

#pragma mark - lazyload
-(TitlePageView *)titlePageView {
    if (!_titlePageView) {
        CGRect frame = CGRectMake(0, kStatusH+kNavigationH, kScreenW, kPageViewH);
        NSArray *titles = @[@"首页",@"推荐",@"热门"];
        _titlePageView = [[TitlePageView alloc] initWithFrame:frame WithTitleArray:titles];
        
    }
    return _titlePageView;
}


@end
